
#ifndef BIT_STREAM_H
#define BIT_STREAM_H

C_BEGIN_DECLS

typedef struct
{
	unsigned char* _data;
	int _length;
} BitStream;

BitStream* bit_stream_new();
BitStream* bit_stream_new_from_num(int length, unsigned int num);
BitStream* bit_stream_new_from_bytes(int size, unsigned char* bytes);
void bit_stream_destroy(BitStream* bit_stream);
int bit_stream_append(BitStream* bit_stream, BitStream* combined);
int bit_stream_append_num(BitStream* bit_stream, int length, unsigned int num);
int bit_stream_append_bytes(BitStream* bit_stream, int size, unsigned char* bytes);
unsigned char* bit_stream_convert_to_bytes(BitStream* bit_stream);

C_END_DECLS

#endif	// BIT_STREAM_H

